	
// LicensInfo.h : Declaration of the CLicensInfo

#ifndef __LICENSINFO_H_
#define __LICENSINFO_H_

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CLicensInfo
class ATL_NO_VTABLE CLicensInfo : 
	public CComObjectRootEx<CComMultiThreadModel>,
	public CComCoClass<CLicensInfo, &CLSID_LicensInfo>,
	public ISupportErrorInfo,
	public IDispatchImpl<ILicensInfo, &IID_ILicensInfo, &LIBID_EBASDLLLib>
{
public:
	CLicensInfo()
	{
		m_pUnkMarshaler = NULL;
	}

DECLARE_REGISTRY_RESOURCEID(IDR_LICENSINFO)
DECLARE_NOT_AGGREGATABLE(CLicensInfo)
DECLARE_GET_CONTROLLING_UNKNOWN()

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CLicensInfo)
	COM_INTERFACE_ENTRY(ILicensInfo)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(ISupportErrorInfo)
	COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
END_COM_MAP()

	HRESULT FinalConstruct()
	{
		return CoCreateFreeThreadedMarshaler(
			GetControllingUnknown(), &m_pUnkMarshaler.p);
	}

	void FinalRelease()
	{
		m_pUnkMarshaler.Release();
	}

	CComPtr<IUnknown> m_pUnkMarshaler;

// ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

// ILicensInfo
public:
	STDMETHOD(get_LicensSlut)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(get_LicensType)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(get_LicensNummer)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(get_LicensTil)(/*[out, retval]*/ BSTR *pVal);

	STDMETHOD(put_LicensSlut)(BSTR pVal) {
		m_slut = pVal;
		return S_OK;
	}
	STDMETHOD(put_LicensType)(BSTR pVal) {
		m_type = pVal;
		return S_OK;
	}
	STDMETHOD(put_LicensNummer)(BSTR pVal) {
		m_nummer = pVal;
		return S_OK;
	}
	STDMETHOD(put_LicensTil)(BSTR pVal) {
		m_til = pVal;
		return S_OK;
	}
private:
	bstr_t m_til, m_nummer, m_type, m_slut;
};

#endif //__LICENSINFO_H_
